﻿<Page
    x:Class="DroneExample.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:DroneExample"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d">

    <Page.Resources>
        <x:String x:Key="AppName">Drone Example</x:String>
    </Page.Resources>

    <Grid Style="{StaticResource LayoutRootStyle}">
        <Grid.RowDefinitions>
            <RowDefinition Height="140"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>
            
            <TextBlock x:Name="pageTitle" Grid.Column="1" Margin="40,30" Text="{StaticResource AppName}" Style="{StaticResource PageHeaderTextStyle}"/>
        </Grid>

        <Button x:Name="connectButton" Click="ConnectToDrone" Grid.Row="1" HorizontalAlignment="Center" VerticalAlignment="Center" Width="200" Height="200" FontSize="30">Connect</Button>
        
        <Grid x:Name="controlGrid" Grid.Row="1" HorizontalAlignment="Center" VerticalAlignment="Center" Visibility="Collapsed">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>
            
            <StackPanel Orientation="Vertical">
                <Button x:Name="takeOffButton" Click="takeOff" Width="200" Height="200" HorizontalAlignment="Center" FontSize="30" Margin="0,0,0,100">Take off</Button>
                <Slider x:Name="rotateSlider" Width="400" Value="0" Minimum="-1" Maximum="1" StepFrequency=".1" ValueChanged="sliderValueChanged" IsEnabled="False"/>
            </StackPanel>
        </Grid>
    </Grid>
</Page>
